<script setup>
import { ref } from 'vue'

const features = ref([
  {
    title: '现代化设计',
    description: '采用最新的设计趋势，提供优雅的用户体验',
    icon: '🎨'
  },
  {
    title: '响应式布局',
    description: '完美适配各种设备尺寸，从手机到桌面',
    icon: '📱'
  },
  {
    title: '高性能',
    description: '优化的加载速度和流畅的交互体验',
    icon: '⚡'
  },
  {
    title: '易于定制',
    description: '灵活的架构设计，轻松满足个性化需求',
    icon: '🔧'
  }
])

const stats = ref([
  { value: '1000+', label: '满意客户' },
  { value: '50+', label: '完成项目' },
  { value: '99%', label: '客户满意度' },
  { value: '24/7', label: '技术支持' }
])
</script>

<template>
  <div class="home">
    <!-- Hero Section -->
    <section class="hero">
      <div class="hero-container">
        <div class="hero-content">
          <h1 class="hero-title">
            构建令人惊叹的
            <span class="gradient-text">现代化网站</span>
          </h1>
          <p class="hero-description">
            我们专注于创建美观、高效、用户友好的网站解决方案，
            帮助您的业务在数字世界中脱颖而出。
          </p>
          <div class="hero-buttons">
            <button class="btn btn-primary">开始项目</button>
            <button class="btn btn-secondary">了解更多</button>
          </div>
        </div>
        <div class="hero-image">
          <div class="mockup-container">
            <div class="browser-mockup">
              <div class="browser-bar">
                <div class="browser-dots">
                  <span></span>
                  <span></span>
                  <span></span>
                </div>
              </div>
              <div class="browser-content">
                <div class="mockup-grid">
                  <div class="mockup-card"></div>
                  <div class="mockup-card"></div>
                  <div class="mockup-card"></div>
                  <div class="mockup-card"></div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>

    <!-- Features Section -->
    <section class="features">
      <div class="container">
        <div class="section-header">
          <h2>核心特色</h2>
          <p>我们提供的专业服务，助您实现业务目标</p>
        </div>
        <div class="features-grid">
          <div v-for="feature in features" :key="feature.title" class="feature-card">
            <div class="feature-icon">{{ feature.icon }}</div>
            <h3>{{ feature.title }}</h3>
            <p>{{ feature.description }}</p>
          </div>
        </div>
      </div>
    </section>

    <!-- Stats Section -->
    <section class="stats">
      <div class="container">
        <div class="stats-grid">
          <div v-for="stat in stats" :key="stat.label" class="stat-item">
            <div class="stat-value">{{ stat.value }}</div>
            <div class="stat-label">{{ stat.label }}</div>
          </div>
        </div>
      </div>
    </section>

    <!-- CTA Section -->
    <section class="cta">
      <div class="container">
        <div class="cta-content">
          <h2>准备好开始您的项目了吗？</h2>
          <p>让我们一起打造令人印象深刻的网站体验</p>
          <button class="btn btn-primary btn-large">立即联系我们</button>
        </div>
      </div>
    </section>
  </div>
</template>

<style scoped>
.home {
  overflow-x: hidden;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 100px 0;
}

.hero-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 4rem;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 6rem;
    align-items: center;
    min-height: 80vh;
  }

.hero-title {
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 2rem;
  }

.gradient-text {
  background: linear-gradient(45deg, #ff6b6b, #ffd93d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
    font-size: 1.5rem;
    line-height: 1.7;
    margin-bottom: 3rem;
    opacity: 0.9;
    max-width: 600px;
  }

.hero-buttons {
  display: flex;
  gap: 1rem;
}

.btn {
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: #ff6b6b;
  color: white;
}

.btn-primary:hover {
  background: #ff5252;
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.btn-secondary:hover {
  background: white;
  color: #667eea;
}

.btn-large {
  padding: 1rem 2.5rem;
  font-size: 1.125rem;
}

/* Hero Image */
.hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.mockup-container {
  width: 100%;
  max-width: 500px;
}

.browser-mockup {
  background: white;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.browser-bar {
  background: #f1f3f4;
  padding: 0.75rem;
  display: flex;
  align-items: center;
}

.browser-dots {
  display: flex;
  gap: 0.375rem;
}

.browser-dots span {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: #ddd;
}

.browser-dots span:nth-child(1) { background: #ff5f57; }
.browser-dots span:nth-child(2) { background: #ffbd2e; }
.browser-dots span:nth-child(3) { background: #28ca42; }

.browser-content {
  padding: 1.5rem;
}

.mockup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.mockup-card {
  height: 80px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 0.25rem;
  opacity: 0.8;
}

/* Features Section */
.features {
  padding: 100px 0;
  background: white;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 4rem;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #1a202c;
}

.section-header p {
  font-size: 1.25rem;
  color: #718096;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
  }

.feature-card {
  text-align: center;
  padding: 2rem;
  border-radius: 0.5rem;
  background: #f7fafc;
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #1a202c;
}

.feature-card p {
  color: #718096;
  line-height: 1.6;
}

/* Stats Section */
.stats {
  padding: 80px 0;
  background: #f7fafc;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3rem;
  text-align: center;
}

.stat-item {
  padding: 1rem;
}

.stat-value {
  font-size: 3rem;
  font-weight: 700;
  color: #667eea;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 1.125rem;
  color: #4a5568;
}

/* CTA Section */
.cta {
  padding: 100px 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-align: center;
}

.cta-content h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.cta-content p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-buttons {
    justify-content: center;
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    width: 200px;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .section-header h2,
  .cta-content h2 {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 60px 0;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .container {
    padding: 0 1rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
</style>
